package com.sd.repay.dao;

import com.sd.repay.common.Page;

import java.util.List;
import java.util.Map;

/**
 * Created by sd on 2017/10/24.
 */
public interface BaseDao {

    Long getSaveObjId(String sql, Object... params);

    <T> List<T> findList(Class<T> tClass, String sql);

    <T> List<T> findList(Class<T> tClass, String sql, Object... params);

    List<Map<String, Object>> findList(String sql);

    List<Map<String, Object>> findList(String sql, Object... params);

    <T> T findFirst(Class<T> classT, String sql);

    <T> T findFirst(Class<T> classT, String sql, Object... args);

    Map<String, Object> findFirst(String sql);

    Map<String, Object> findFirst(String sql, Object... params);

    int execute(String sql);

    int execute(String sql, Object... params);

    int[] batchExecute(String sql);

    int[] batchExecute(String sql, List<Object[]> objs);

    <T> Page<T> queryPagination(Class<T> tClass, int pageNo, int pageSize, final String sql);

    <T> Page<T> queryPagination(Class<T> entity, int pageNo, int pageSize, String sql, Object... parameters);

    Page<Map<String, Object>> queryPagination(int pageNo, int pageSize, String sql, Object... parameters);
}
